﻿using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Identity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WeChatIdentity.Models;

namespace IdentityServer.Data.Repositories
{
    public interface IUserRepository
    {

        Task<ApplicationUser> AddUserAsync(ApplicationUser user);

        void UpdateUser(ApplicationUser user);

        Task<ApplicationUser> GetUserByOpenIdAsync(string openid);

        Task<ApplicationUser> FindByUsername(string user);

        Task<bool> ValidateCredentialsAsync(ApplicationUser user, string password);

        void UpdateUserClaim(UserClaim claim);
        Task<IEnumerable<IdentityUserClaim<string>>> GetUserClaimsByUserId(string userId);

        Task SignIn(ApplicationUser user);

        Task SignInAsync(ApplicationUser user, AuthenticationProperties properties, string authenticationMethod = null);
    }
}
